home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #14 / Monster Media No. 14 (April 1996) (Monster Media, Inc.).ISO / prog_bas / msgbxcls.zip / README.TXT < prev   
Text File  |  1996-01-06  |  5KB  |  131 lines

  1. MsgBox is a simple class module that provides (hopefully) a 
  2. useful bit of functionality. The VB MsgBox function has had some 
  3. idiosyncrasies in the past which may still exist in VB4 (though 
  4. I'm not sure of it). Under VB3 I used a wrapper function around 
  5. the API MessageBox function as a replacement. Now I've ported it
  6. to VB4 and made it an object (i.e. class). Creating new versions 
  7. should be easy as well. You can replace the MessageBox call with
  8. your own form and code, make message boxes that time-out, add
  9. animation capabilities, use custom icons, etc.
  10.  
  11. This software, and the included source code, is FREEWARE.
  12.  
  13. You may use it as you see fit in your own projects but you may 
  14. not re-sell the original or a derivative. If you redistribute 
  15. it you must include this disclaimer and all original copyright
  16. notices. 
  17.  
  18. No warranty is inferred or implied, as always seems to be the
  19. case with software these days. Use at your own risk. Keep away
  20. from small children. Don't exceed recommended dosage. I'm not
  21. liable, I'm not liable, I'm not liable.
  22.  
  23. I'd love to see people improve upon this work. Please keep me 
  24. posted if you do. If you should happen to change the behavior
  25. in a derivative version please change the class name so as not
  26. to cause problems with existing code.
  27.  
  28. Enjoy!
  29.  
  30. --Gregg Irwin [72450,676]
  31.  
  32. --------------------------------------------------------------
  33.     Possible Enhancements
  34.  
  35.     I'm thinking about the HelpFile and Context options that
  36.     the VB MsgBox function now offers. This would require 
  37.     using the MessageBoxIndirect API function which isn't 
  38.     available under Win16 (AFAIK). MessageBoxIndirect requires
  39.     a callback function to process Help commands so, if you
  40.     want to add HelpFile and Context properties your best bet
  41.     might be to use the VB MsgBox function internally rather
  42.     than the API calls.
  43.  
  44.     MessageBoxEx could also be used to add multi-language 
  45.     support.
  46.  
  47. --------------------------------------------------------------
  48.     What's New?  01/06/96
  49.  
  50.     The MsgBox class is unchanged. The sample project, though,
  51.     now inlcudes a code generator that will generate code to
  52.     paste into your projects. This lets you use the sample
  53.     project as a message box designer.
  54.  
  55.     The generated code is placed into a text box so you can
  56.     review it and copy it to the clipboard to paste into your
  57.     projects. Since all the source is included you can tweak
  58.     the code generator to match your standards and style.
  59.  
  60.     The code generator isn't a great piece of sample code
  61.     because I put it together very quickly. It can certainly
  62.     be improved. Thanks to Bill Antonacchio for the impetus.
  63.  
  64. --------------------------------------------------------------
  65.  
  66. Q. How do I use it?
  67.  
  68. A. It's easy.
  69.  
  70.    1. Dim a variable to hold the message box.
  71.  
  72.       Example: Dim MB As New clsMsgBox
  73.  
  74.    2. Set the Title of the message box.
  75.  
  76.       Example: MB.Title = "Reformat Drive"
  77.  
  78.    3. Set the Message of the message box.
  79.  
  80.       Example: MB.Message = "Are you sure you want to do that?"
  81.  
  82.    4. Set the Style of the message box.
  83.  
  84.       Example: MB.Style = vbYesNo + vbQuestion
  85.  
  86.    5. Display the message box and handle the return value.
  87.  
  88.       Example: Dim Rtn as Integer
  89.                Rtn = MB.ShowModal
  90.  
  91. --------------------------------------------------------------
  92.  
  93. Q. What if I hate setting all those properties? I'd rather 
  94.    use it like the MsgBox function in VB.
  95.  
  96. A. No problem. The ShowModal method takes all the required
  97.    settings as optional parameters.
  98.  
  99.    Example: Rtn = MB.ShowModal(Msg, Style, Title, (FormX.HWnd))
  100.  
  101.    Note: The final HWnd parameter is used by the API 
  102.    MessageBox function.
  103.  
  104. --------------------------------------------------------------
  105.  
  106. Q. Why a class module?
  107.  
  108. A. Why not? It has a defined interface. It provides 
  109.    encapsulation. It allows you to create multiple instances
  110.    easily. It can be used as an OLE server. It can raise
  111.    errors effectively. 'nuff said?
  112.  
  113. --------------------------------------------------------------
  114.  
  115. Q. What if I have suggestions, requests, or improvements?
  116.  
  117. A. Send them to me and I'll get back to you as quickly as I 
  118.    can. Hopefully we can make it a community effort and build
  119.    up a good library of tools that we can all draw upon.
  120.  
  121. --------------------------------------------------------------
  122.  
  123. Q. What if it has a bug in it that costs me millions of 
  124.    dollars?
  125.  
  126. A. Re-read the disclaimer and let me know about the bug 
  127.    please.<g>
  128.  
  129. --------------------------------------------------------------
  130.  
  131.